Skip to main content

randomSeed

Type

property

Summary

Determines the seed value used to generate random numbers.

Syntax

set the randomSeed to <integer>

Description

Use the randomSeed property to ensure greater randomness when generating random numbers.

Changing the randomSeed property changes the pseudorandom numbers generated by the random function and used by the any keyword. Using the same seed creates the same sequence of pseudorandom values.

For example, if you call the random function five times to generate a list of five numbers, then change the randomSeed to another value, the next five calls to the random function will produce a different list of five numbers. However, if you set the randomSeed back to its original value and call the random function five more times, the list of five numbers is the same as the first list you generated.

LiveCode uses a new randomSeed every time the application is started up.

Examples

set the randomSeed to 4570422

glossary: property, keyword, application, value, call

keyword: any, integer

command: call

function: random, value

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?